package com.jsftoolkit.gen.config;

import javax.xml.xpath.XPathExpressionException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Interface for classes that update faces-config.xml.
 * 
 * @author noah
 * 
 */
public interface FacesConfigEditor {
	/**
	 * Creates or updates the appropriate component element.
	 * 
	 * @param doc
	 * @param componentType
	 * @param componentClass
	 * @return the component element
	 * @throws XPathExpressionException
	 */
	Element registerComponent(Document doc, String componentType,
			String componentClass) throws XPathExpressionException;

	/**
	 * Creates or updates the appropriate renderer element.
	 * 
	 * @param doc
	 * @param componentFamily
	 * @param rendererType
	 * @param rendererClass
	 * @param renderKitId
	 *            id of the render kit. null for the default (no id)
	 * @return the renderer element
	 * @throws XPathExpressionException
	 */
	Element registerRenderer(Document doc, String componentFamily,
			String rendererType, String rendererClass, String renderKitId)
			throws XPathExpressionException;
}
